<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>数组</title>
</head>
<body>
<script>
    var names = [];
    names[0] = 'Jeremy';
    names[1] = 'Paul';
    names[2] = 'John';

    document.write('names[0] = ' + names[0] + '<br/>');
    document.write('names[2] = ' + names[1] + '<br/>');
    document.write('names[1] = ' + names[1] + '<br/>');

    names[1] = 'Mike';
    document.write('names[1] changed to ' + names[1]);
</script>
</body>
</html>